package pluginUtils;

public class Monome {
	private double coef; 
	private int exponent;
	
	/**
	 * @param coef
	 * @param exponent
	 */
	public Monome(double coef, int exponent) {
		this.coef = coef;
		this.exponent = exponent;
	}
	
	/**
	 * @return the coef
	 */
	public double getCoef() {
		return coef;
	}
	/**
	 * @param coef the coef to set
	 */
	public void setCoef(double coef) {
		this.coef = coef;
	}
	/**
	 * @return the exponent
	 */
	public int getExponent() {
		return exponent;
	}
	/**
	 * @param exponent the exponent to set
	 */
	public void setExponent(int exponent) {
		this.exponent = exponent;
	} 
	
	public Complexe eval(Complexe z){
		if(coef==0) return Complexe.ZERO; 
		Complexe resu=Complexe.UN;
		for(int i=0;i<exponent;i++)
			resu=Complexe.mul(resu,z); 
		return Complexe.mulbyDouble(resu,coef);
	}
	public String toString(){
		return coef+"*z^"+exponent;
	}

}
